/*
*************************************
* PocketGTT
*************************************
This file is part of PocketGTT.

PocketGTT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PocketGTT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PocketGTT.  If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 1.0

Rectangle {
    height: textGroup.height  + 20   //85
    width: parent.width

    color: "transparent"
//    color: myWin.theme.preferred_list_background// "#4d4d4d60"

    property int count: ListView.view.count

    clip: true

    Item {
        id: textGroup
        height: sTitle.height + listaOrari.height + 8
        width: parent.width * 0.95
        //        anchors.left: parent.left
        //        anchors.leftMargin: 8
        //        anchors.right: btnImgInfoBack.left
        //        anchors.rightMargin: 8
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter

        Text {
            id: sTitle
            text: "Linea: " + myWin.statesMan.fermata.getLineaNumeroByIndex(index)

            anchors.top: parent.top
            anchors.horizontalCenter: parent.horizontalCenter
            color: "white"
            elide: Text.ElideRight
            width: parent.width
            font.pixelSize: myWin.theme.textSizeM  //26
        }

        ListView {
            id: listaOrari

            anchors.bottom: parent.bottom
            anchors.horizontalCenter: parent.horizontalCenter
            width: parent.width
            height: sTitle.height

            clip: true
            orientation: ListView.Horizontal
            interactive: false

            //            Component.onCompleted: console.log(listaOrari.height)

            property variant mylista: myWin.statesMan.fermata.LineaOrarioByIndexNum//.at(index)
            //            property variant mylistaCorrection: myWin.statesMan.fermata.getLineaRealTimeByIndex(index)
            property int myIndex: index

            model: mylista[index]

            delegate: PassaggiViewContent_StopListTimeDelegate {
                //                mytext: modelData
            }




        }

    }

    Separator {
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
        height: (index===0) ? 0 : 1
        color: myWin.theme.violet_background
    }
    // find a way to remove to bottom separator for the last item!!!
    Separator {
        anchors.bottom: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        height: (index===(parent.count-1)) ? 0 : 1
        color: myWin.theme.violet_background
    }

}

